package com.theyeasy.dvmini.coreservlets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

import com.theyeasy.dvmini.service.AutoreplyService;
import com.theyeasy.dvmini.util.KeywordUtil;
 

/**
 * spring 容器加载
 * 
 * @author Administrator
 * 
 */
@Component("BeanDefineConfigue")
public class BeanDefineConfigue implements ApplicationListener<ContextRefreshedEvent> {
	
	 @Autowired
	 AutoreplyService autoService;
 
	@Override
	public void onApplicationEvent(ContextRefreshedEvent arg0) {
	    if (arg0.getApplicationContext().getParent() == null) {// root
	        try {
                autoService.init();
               
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
	    }
	}
}
